package com.itheima.mapper;

import com.itheima.vo.JobVo;
import com.itheima.vo.SexVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReportMapper {

    @Select("select if(gender=1,'男','女' ) as name ,count(gender) as value from emp group by gender")
    List<SexVo> sex();

    /* @Select("select case when job=1 then '班主任' when job=2 then '讲师'when job=3 then '学工主管'when job=4 then '教研主管' else '未知' end as name ,count(job) as value from emp group by job")*/
    @Select("select case when job=1 then '班主任' when job=2 then '讲师'when job=3 then '学工主管'when job=4 then '教研主管' when job=5 then '咨询师' else '未知' end as name ,count(job) as value from emp group by job")
    List<JobVo> job();
}
